
<html>
<head>
  <meta charset="utf-8">
  <title>layui</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <link rel="stylesheet" href="/static/layui/dist/css/layui.css"  media="all">
  <!-- 注意：如果你直接复制所有代码到本地，上述css路径需要改成你本地的 -->
</head>
<body>

<blockquote class="layui-elem-quote" style="    margin-bottom: 0px;">
  本页面提供用户浏览和删除51Job的数据爬取信息,用户可点击"查看"进行数据的查看、用户可点击"删除"进行数据的删除.<b>你可以拖动下方的滑条,浏览该条数据的全部信息列.</b>
    <b>由于表格长度限制的数据没有显示完全，你可以点击该单元格进行详情查看.</b>

{#  <a class="layui-btn layui-btn-normal" href="table.html" target="_blank">表格模块示例</a>#}
</blockquote>
<div class="layui-row layui-col-space2" >
<div class="layui-col-xs12 layui-col-sm12 layui-col-md12">
<table class="layui-table" lay-data="{ url:'/return/admin/DataDetails/?key=51job', page: true, limit: 15, limits:[10,15,20,30,50]}" lay-filter="demo">
  <thead>
    <tr>
{#      <th lay-data="{checkbox:true, fixed:'left'}" rowspan="2"></th>#}
      <th lay-data="{field:'data_id',fixed:'left', width:60 }" rowspan="2">id</th>
      <th lay-data="{field:'job_title', width:193,fixed:'left'}" rowspan="2">标题</th>
      <th lay-data="{align:'center'}" colspan="4">职位信息</th>
      <th lay-data="{align:'center'}" colspan="4">职位要求</th>
      <th lay-data="{align:'center'}" colspan="5">公司信息</th>
{#      <th lay-data="{field:'work_experience', width:120}" rowspan="2">金额</th>#}
      <th lay-data="{fixed: 'right', width: 160, align: 'center', toolbar: '#barDemo'}" rowspan="3">操作</th>
    </tr>
    <tr>

      <th lay-data="{field:'job_type', width:226}" >职位类型</th>
      <th lay-data="{field:'job_pay', width:114}">工资</th>
      <th lay-data="{field:'num_people', width:118}">招聘人数</th>
      <th lay-data="{field:'job_boon', width:200}">福利</th>

      <th lay-data="{field:'job_duties', width:200}">职位描述</th>
      <th lay-data="{field:'job_requirement', width:200}">职位要求</th>
      <th lay-data="{field:'work_experience', width:107}">工作经验</th>
      <th lay-data="{field:'academic', width:76}">学历</th>

      <th lay-data="{field:'company_name', width:231}">招聘公司</th>
      <th lay-data="{field:'company_type', width:97}">公司类型</th>
      <th lay-data="{field:'recruit_way', width:120}">招聘方式</th>
      <th lay-data="{field:'add_time', width:93}">发布时间</th>
      <th lay-data="{field:'job_place', width:120}">工作地点</th>

    </tr>
  </thead>
</table>
</div>
</div>


<script type="text/html" id="barDemo">
{#  <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">下移</a>#}
  <a class="layui-btn layui-btn-xs" lay-event="edit">查看</a>
  <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<script src="/static/layui/dist/layui.js" charset="utf-8"></script>
<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>
layui.use('table', function(){
  var table = layui.table;
    //监听表格复选框选择
  table.on('checkbox(demo)', function(obj){
    console.log(obj)
  });
  //监听工具条
  table.on('tool(demo)', function(obj){
    var data = obj.data;
    if(obj.event === 'detail'){
      layer.msg('ID：'+ data.id + ' 的查看操作');
    } else if(obj.event === 'del'){
      layer.confirm('真的删除行么', function(index){
        obj.del();
        layer.close(index);
      });
    } else if(obj.event === 'edit'){
{#        inData(data);#}
{#        form.render('select', 'test2');#}
        layer.alert('编辑行：<br>'+ JSON.stringify(data))
    }
  });

  var $ = layui.$, active = {
    getCheckData: function(){ //获取选中数据
      var checkStatus = table.checkStatus('idTest')
      ,data = checkStatus.data;
      layer.alert(JSON.stringify(data));
    }
    ,getCheckLength: function(){ //获取选中数目
      var checkStatus = table.checkStatus('idTest')
      ,data = checkStatus.data;
      layer.msg('选中了：'+ data.length + ' 个');
    }
    ,isAll: function(){ //验证是否全选
      var checkStatus = table.checkStatus('idTest');
      layer.msg(checkStatus.isAll ? '全选': '未全选')
    }
  };

  $('.demoTable .layui-btn').on('click', function(){
    var type = $(this).data('type');
    active[type] ? active[type].call(this) : '';
  });
});
</script>

</body>
</html>